package com.ma.imclient.task;

import com.ma.common.contant.IMRedisKey;
import com.ma.common.enums.IMListenerType;
import com.ma.common.model.IMSendResult;
import com.ma.common.mq.RedisMQListener;
import com.ma.imclient.listener.MessageListenerMulticaster;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@RequiredArgsConstructor
@RedisMQListener(queue = IMRedisKey.IM_MESSAGE_GROUP_QUEUE,batchSize = 100)
public class GroupMessageResultResultTask extends AbstractMessageResultTask<IMSendResult> {
    private final MessageListenerMulticaster listenerMulticaster;

    @Override
    public void onMessage(List<IMSendResult> datas) {
         listenerMulticaster.multicast(IMListenerType.GROUP_MESSAGE,datas);
    }
}
